import {request} from './request'
const http = {
    get(url, params) {
        const config = {
            method: 'get',
            url: url,
            // params:qs.stringify(params)
        }
        if (params) config.params = params
        return request(config)
    },
    getBlob(url, params) {
        const config = {
            method: 'get',
            url: url,
            // responseType:'blob'
            // params:qs.stringify(params)
        }
        if (params) config.params = params
        return request(config)
    },
    post(url, data) {
        const config = {
            method: 'post',
            url: url
        }
        if (data) config.data = data
        return request(config)
    },
    postformdata(url, data) {
        const config = {
            method: 'post',
            url: url,
            headers: {'Content-Type': 'multipart/form-data'}
        }
        if (data) config.data = data
        return request(config)
    },
    put(url, data) {
        const config = {
            method: 'put',
            url: url
        }
        if (data) config.data = data
        return request(config)
    },
    putdata(url, data) {
        const config = {
            method: 'put',
            url: url,
            headers: {
                'Content-Type': 'multipart/form-data'
            }
        }
        if (data) config.data = data
        return request(config)
    },
    delete(url, params) {
        const config = {
            method: 'delete',
            url: url
        }
        if (params) config.params = params
        return request(config)
    },
    //事件导出


}
export default http
